import requests
from bs4 import BeautifulSoup
import urllib.request as urllib2

# request = 'https://www.wjx.cn/vj/QSpKVGa.aspx'
# response = urllib2.urlopen(request)
# res = response.read()

res = requests.get(url="https://www.wjx.cn/vj/QSpKVGa.aspx")  # 网站输入自己需要爬取的网站
res.encoding = 'utf-8'
soup = BeautifulSoup(res.text, "html.parser")
print(soup)
subject = soup.findAll(attrs={"class": "div_title_question"})
print(subject)
for sub in subject:

    question = sub.find(attrs={"class": "div_title_question"})

    answer = sub.findAll(attrs={"class": "label"})

    print(question.text)

    for an in answer:
        print(an.text)

    print()
